<template>
  <div class="app-container">
    <div class="custom_card_0">
      <el-form
        inline
        :model="form"
        size="mini"
        ref="queryForm"
        label-width="70px"
        label-position="right"
        v-show="showSearch"
      >
        <el-form-item label="订单编号" prop="orderNo">
          <el-input
            v-model="form.orderNo"
            clearable
            @1clear="handleQuery"
            style="width: 220px"
            placeholder="请输入订单编号"
          ></el-input>
        </el-form-item>
        <el-form-item label="预定车型" v-if="false" prop="modelId">
          <el-select
            v-model="form.modelId"
            clearable
            @1clear="handleQuery"
            style="width: 220px"
          >
            <el-option label="全部" :value="0"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="客户名称" prop="memberName">
          <el-input
            v-model="form.memberName"
            clearable
            @1clear="handleQuery"
            style="width: 220px"
            placeholder="请输入客户名称"
          ></el-input>
        </el-form-item>
        <el-form-item label="司机名称" prop="driverName">
          <el-input
            v-model="form.driverName"
            clearable
            @1clear="handleQuery"
            style="width: 220px"
            placeholder="请输入司机名称"
          ></el-input>

        </el-form-item>
        <el-form-item label="预约门店" prop="reserveTakeStoreId">
          <el-select
            v-model="form.reserveTakeStoreId"
            clearable
            @1clear="handleQuery"
            style="width: 220px"
          >
            <el-option
              v-for="item in storeOptions"
              :key="item.storeId"
              :label="item.storeName"
              :value="item.storeId"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="订单状态" prop="orderStatus">
          <el-select
            v-model="form.orderStatus"
            clearable
            @1clear="handleQuery"
            style="width: 220px"
          >
            <template v-for="dict in dict.type.chartered_bus_order_status">
              <el-option
                :label="dict.label"
                :value="dict.value"
                :key="dict.value"
              ></el-option>
            </template>
          </el-select>
        </el-form-item>
        <el-form-item label="车牌号" prop="carNo">
          <el-input
            v-model="form.carNo"
            clearable
            style="width: 220px"
            placeholder="请输入车牌号"
          ></el-input>
        </el-form-item>

        <el-form-item label="下单时间" prop="startTime">
          <el-date-picker
            clearable
            style="width: 360px"
            size="small"
            v-model="orderTimeRange"
            type="daterange"
            range-separator="至"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            start-placeholder="开始时间"
            @change="changeTime"
            end-placeholder="结束时间"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button
            type="primary"
            icon="el-icon-search"
            size="mini"
            @click="handleQuery"
          >搜索
          </el-button
          >
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置
          </el-button
          >
        </el-form-item>
      </el-form>
    </div>
    <div class="custom_card">
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            class="first-plain-btn" size="medium"
            icon="el-icon-plus"
            @click="handleAdd"
          >新&nbsp;&nbsp;增
          </el-button>
          <!--          v-hasPermi="['order:charteredBus:add']"-->


        </el-col>
        <right-toolbar
          :showFolding="true"
          :showSearch.sync="showSearch"
          :lineFolding.sync="lineFolding"
          @queryTable="getList"
        ></right-toolbar>
      </el-row>

      <el-table v-loading="loading" :data="list" border>
        <el-table-column label="订单编号" align="center" min-width="220" show-overflow-tooltip>
          <template slot-scope="{ row }">
            <span style="font-size: 14px; color: #1890ff;cursor:pointer;" @click="handleDetail(row)">{{ row.orderNo }}</span>
          </template>
        </el-table-column>
        <el-table-column label="承租人" align="center" min-width="130" show-overflow-tooltip>
          <template slot-scope="{ row }">
            <div v-if="lineFolding">
              {{ row.memberName }}
              <div>{{ row.memberPhone }}</div>
              <span v-if="row.memberType==1">企业客户</span>
              <span v-else>个人客户</span>
            </div>

            <span v-else>{{ row.memberName }}&nbsp;&nbsp;{{ row.memberPhone }}&nbsp;&nbsp;
               <span v-if="row.memberType==1">企业客户</span>
              <span v-else>个人客户</span>
            </span>
          </template>
        </el-table-column>

        <el-table-column label="取车信息" align="center" min-width="240" show-overflow-tooltip prop="rentalStartTime">
          <template slot-scope="{ row }">
            <div v-if="lineFolding">
              <div>{{ row.reserveAlsoStoreName }}</div>
              <span>{{ row.rentalStartTime }}</span>
            </div>
            <span v-else> {{ row.reserveAlsoStoreName }}&nbsp;&nbsp;&nbsp;
              <span>{{ row.rentalStartTime }}</span>
            </span>
          </template>
        </el-table-column>
        <el-table-column label="还车信息" align="center" min-width="240" show-overflow-tooltip prop="rentalEndTime">
          <template slot-scope="{ row }">
            <div v-if="lineFolding">
              <div>{{ row.reserveAlsoStoreName }}</div>
              <span>{{ row.rentalEndTime }}</span>
            </div>
            <span v-else> {{ row.reserveAlsoStoreName }}&nbsp;&nbsp;&nbsp;
              <span>{{ row.rentalEndTime }}</span>
            </span>
          </template>
        </el-table-column>
        <el-table-column label="租期/租金总金额" align="center" min-width="140" show-overflow-tooltip>
          <template slot-scope="{ row }">
            <div>{{ row.tenancyTerm }}{{ 1 == row.useTimeType ? '小时' : 2 == row.useTimeType ? '天' : 3 == row.useTimeType ? '月' : '' }}/¥{{ row.rent }}</div>
          </template>
        </el-table-column>
        <el-table-column label="押金金额" align="center" min-width="140" show-overflow-tooltip>
          <template slot-scope="{ row }">
            <div>¥{{ row.deposit }}</div>
          </template>
        </el-table-column>
        <el-table-column label="代驾费" align="center" min-width="140" show-overflow-tooltip>
          <template slot-scope="{ row }">
            <div>{{ row.valetDrivingFee ? '¥' + row.valetDrivingFee : '--' }}</div>
          </template>
        </el-table-column>

        <el-table-column label="预定车型" align="center" prop="actualModelName" min-width="130" show-overflow-tooltip/>
        <el-table-column label="车牌号" align="center" prop="carNo" min-width="130" show-overflow-tooltip>
          <template slot-scope="{ row }">
<!--             <span :class="row.carNo.length > 7 ? 'car_no_new' : 'car_no'" v-if="row.carNo" @click="handlePeiche(row)">-->
<!--                {{ row.carNo.substr(0, 2) }}<b class="dian">·</b>{{ row.carNo.substr(2) }}-->
<!--              </span>-->
<!--            <span style="font-size: 14px; color: #1890ff;cursor:pointer;" @click="handlePeiche(row)" v-else-if="row.orderStatus==1">{{ '点击排车' }}</span>-->
<!--            <span style="font-size: 14px;" v-else>&#45;&#45;</span>-->
            <span v-if="row.orderStatus>1">{{row.carNo}}</span>
            <span v-else>--</span>
          </template>
        </el-table-column>
        <el-table-column label="订单状态" align="center" min-width="200" show-overflow-tooltip prop="orderStatus">
          <template slot-scope="{ row }">
            <span style="display: inline-block">
              <span>
                <dict-tag style="display: inline-block" :options="dict.type.chartered_bus_order_status" :value="row.orderStatus"/>
              </span>
            </span>
          </template>
        </el-table-column>
        <el-table-column label="订单来源" align="center" min-width="130" show-overflow-tooltip>
          <template slot-scope="{ row }">
            <dict-tag :options="dict.type.sys_order_source" :value="row.orderSource"/>
          </template>
        </el-table-column>
        <el-table-column label="业务员" align="center" min-width="130" show-overflow-tooltip prop="salesman">
          <template slot-scope="{ row }">
            <div>{{ row.salesman || '--' }}</div>
          </template>
        </el-table-column>

        <el-table-column label="司机名称" align="center" min-width="130" show-overflow-tooltip prop="driverName">
          <template slot-scope="{ row }">
            <div>{{ row.driverName || '--' }}</div>
          </template>
        </el-table-column>

        <el-table-column label="下单时间" align="center" min-width="130" show-overflow-tooltip prop="createTime"/>

        <el-table-column label="操作" width="150" fixed="left" align="center">
          <!-- 订单状态 0-待支付 1-待排车 2 待分配司机 3 司机接单中 4 业务员给车中 5.接客户中 6 -待给客户交车 7-用车中 8-换车中 9-退车中 10-已退车 11-已取消 -->
          <template slot-scope="{ row }">
            <!--              &&checkPermi(['order:charteredBus:supplyCar'])-->

            <el-button type="text" size="mini" @click="handleDetail(row)">订单详情</el-button>

            <el-dropdown size="mini" @command="(command) => handleCommand(command, row)">
              <span class="el-dropdown-link"> <i class="el-icon-d-arrow-right el-icon--right"></i>更多</span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item command="handlePeiche" v-if="row.orderStatus == 1" icon="el-icon-search">订单排车</el-dropdown-item>
                <el-dropdown-item command="handleDispatchDriver" v-if="row.orderStatus == 2" icon="el-icon-search">分配司机</el-dropdown-item>
                <el-dropdown-item command="handleJiaocheyanche" v-if="row.orderStatus == 4" icon="el-icon-search">交车验车</el-dropdown-item>
                <el-dropdown-item command="upReport" v-if="row.orderStatus == 7&&row.driverName!=null" icon="el-icon-search">日程上报</el-dropdown-item>
                <el-dropdown-item command="handleHuancheyanche" v-if="row.orderStatus == 7" icon="el-icon-search">还车验车</el-dropdown-item>
                <el-dropdown-item command="handleEdit" v-if="row.orderStatus <1 &&row.rentIspay==1&&row.depositIspay==1" icon="el-icon-search">编辑订单</el-dropdown-item>
                <el-dropdown-item command="handleCancel" v-if="row.orderStatus < 1 &&row.rentIspay==1&&row.depositIspay==1 " icon="el-icon-search">取消订单</el-dropdown-item>
                <el-dropdown-item command="handleDelete" v-if=" (row.orderStatus < 1 || row.orderStatus == 11) &&row.rentIspay==1&&row.depositIspay==1 " icon="el-icon-search">删除订单</el-dropdown-item>

                <el-dropdown-item command="handleReportRecord" v-if="row.orderStatus >= 7&&row.orderStatus != 11&&row.driverName!=null" icon="el-icon-search">司机日程</el-dropdown-item>
                <el-dropdown-item command="handleJiaocheyanchelist" v-if="row.orderStatus > 4&&row.orderStatus != 11" icon="el-icon-search">交车验车单</el-dropdown-item>
                <el-dropdown-item command="handleHuancheyanchelist" v-if="row.orderStatus > 7&&row.orderStatus != 11" icon="el-icon-search">还车验车单</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="pageNum"
        :limit.sync="pageSize"
        @pagination="getList"
      />
    </div>
    <!--   配车弹框-->
    <el-dialog title="去配车" :visible.sync="showpeiche" width="1000px" destroy-on-close append-to-body @close="closeDiolog(true)">
      <MmvPeiche ref="MmvPeiche" v-if="showpeiche"
                 :modelId="nowRow.actualModelId" :storeId="nowRow.reserveAlsoStoreId" :orderNo="nowOrderNo"
                 @success="showpeiche = false" @show="showpeiche = true"></MmvPeiche>
      <div slot="footer">
        <el-button @click="showpeiche = false">关闭</el-button>
      </div>
    </el-dialog>

    <!--    配司机弹框-->
    <el-dialog title="分配司机" :visible.sync="showDriver" width="1000px" destroy-on-close
               append-to-body @close="showDriver = false">
      <MmvDriver ref="MmvDriver" :storeId="nowRow.reserveAlsoStoreId" :driverType="nowRow.driverType" v-if="showDriver" @success="confimDriver"></MmvDriver>
      <div slot="footer">
        <el-button @click="showDriver = false">关闭
        </el-button>
      </div>
    </el-dialog>

    <schedule-report ref="ScheduleReport" @success="handleQuery"></schedule-report>

    <el-dialog title="交车验车单" :visible.sync="showjiaocheyanchelist" width="1000px" destroy-on-close append-to-body @close="closeDiolog(false)">
      <MmvDeliveryList ref="MmvDeliveryList" v-if="showjiaocheyanchelist" :orderNo="nowOrderNo" :type="1" @close="showjiaocheyanchelist = false"></MmvDeliveryList>
      <div slot="footer">
        <el-button @click="showjiaocheyanchelist = false">关闭</el-button>
      </div>
    </el-dialog>

    <el-dialog title="还车验车单" :visible.sync="huancheyanchelist" width="1000px" destroy-on-close append-to-body @close="closeDiolog(false)">
      <MmvDeliveryList ref="MmvDeliveryList" v-if="huancheyanchelist" :orderNo="nowOrderNo" :type="2" @close="huancheyanchelist = false"></MmvDeliveryList>
      <div slot="footer">
        <el-button @click="huancheyanchelist = false">关闭</el-button>
      </div>
    </el-dialog>

    <el-dialog title="司机日程" :visible.sync="showReportRecord" width="85%" destroy-on-close append-to-body @close="closeDiolog(false)">
      <ReportRecord ref="ReportRecord" v-if="showReportRecord" :orderNo="nowOrderNo" @close="showReportRecord = false"></ReportRecord>
      <div slot="footer">
        <el-button @click="showReportRecord = false">关闭</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>

import {charteredBuslist, charteredcancel, chartereddelete, charteredDistributionDriver} from "@/api/charteredBus/detail";
import {getAllStore} from '@/api/store/store'
import MmvPeiche from "@/views/charteredBus/order/components/pageche.vue";
import MmvDriver from "@/views/charteredBus/order/components/chooseDriver.vue";
import ScheduleReport from "@/views/charteredBus/order/components/scheduleReport.vue";
import MmvDeliveryList from "@/views/charteredBus/order/components/delivery-detail.vue";
import ReportRecord from "@/views/charteredBus/order/components/reportRecord.vue";


export default {
  components: {ReportRecord, MmvDeliveryList, MmvDriver, MmvPeiche,ScheduleReport},
  dicts: ['sys_order_source', 'chartered_bus_order_status'],
  data() {
    return {
      orderTimeRange: [],
      refundConfirmTitle: '',
      refundConfirmType: 3,
      showDepositRefundConfirm: false,
      showorderRefund: false,
      showReportRecord: false,
      pingzheng: {
        title: '',
        show: false,
        bizType: 0,
      },
      form: {
        orderNo: '', //订单编号
        modelId: '', //预定车型id
        memberName: '', //客户名称
        memberType: '', //客户类型(字典:memberType)
        startTime: '',
        endTime: '',
        carNo: '',
        driverName: '',
        // rentalTime: [], // 预定租赁时间
        reserveTakeStoreId: '', //预约门店
        orderSource: '', //订单来源(字典:sys_order_source)
        orderStatus: '', //订单状态(字典:chartered_bus_order_status)
      },
      pageNum: 0, //页码   必选
      pageSize: 10, //每页显示数据 必选
      // 门店数据
      storeOptions: [],
      addSubmitLoading: false,
      loading: true,
      list: [],
      total: 0,
      // 非多个禁用
      multiple: true,
      // 弹出层标题
      title: '',
      // 显示搜索条件
      showSearch: true,
      lineFolding: false,
      // 是否显示弹出层
      nowOrderNo: null, // 当前选择订单id
      nowRow: null, // 当前选择
      open: false, // 显示新增/编辑
      showpeiche: false, // 显示配车
      showDriver: false, // 显示司机列表
      showScheduleReport: false,//显示日程上报


      showjiaocheyanche: false, // 显示交车验车
      showjiaocheyanchelist: false, // 显示交车验车单
      huancheyanche: false, // 显示还车验车
      huancheyanchelist: false, // 显示还车验车单
      showfeiyongmingxi: false, // 显示费用明细
      showdingdanlog: false, // 显示订单日志
      showsettlement: false, // 显示押金结算明细
      showDepositRefund: false, // 显示押金结算退款
      showIllegalProcessing: false, // 显示违章结算明细
      finalStatement: false, // 显示结算单
      showChangeCar: false, // 显示申请换车
    }
  },
  mounted() {
    this.getList()
    this.getAllStore()
  },
  activated() {
    this.getList()
  },
  methods: {
    params() {
      const params = {
        orderNo: this.form.orderNo, //订单编号
        pageNum: this.pageNum, //页码   必选
        pageSize: this.pageSize, //每页显示数据 必选
        reserveStoreId: this.form.reserveTakeStoreId, //预约取车门店
        orderStatus: this.form.orderStatus, //订单状态(字典:chartered_bus_order_status)
        carNo: this.form.carNo,
        startTime: this.form.startTime, //预定租赁开始时间
        endTime: this.form.endTime, //预定租赁结束时间
        memberName: this.form.memberName, //客户名称
        driverName: this.form.driverName,
      }
      return params
    },

    //租赁时间改变
    changeTime(times) {
      this.form.startTime = times[0] + ' 00:00:00';
      this.form.endTime = times[1]+' 23:59:59';
    },

    /** 查询部门下拉树结构 */
    getAllStore() {
      getAllStore().then((response) => {
        this.storeOptions = response.data
      })
    },
    /** 查询列表 */
    getList() {
      this.loading = true
      let params = this.params()
      charteredBuslist(params).then((response) => {
        this.list = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 更多操作触发
    handleCommand(command, row) {
      switch (command) {
        case 'handlePeiche':
          this.handlePeiche(row)
          break
        case 'handleEdit':
          this.handleEdit(row)
          break
        case  'handleDispatchDriver':
          this.handleDispatchDriver(row)
          break
        case 'handleJiaocheyanche':
          this.handleDeliveryCar(row, 1)
          break
        case 'upReport':
          this.$refs.ScheduleReport.show(row.orderNo)
          break
        case 'handleHuancheyanche':
          this.handleDeliveryCar(row, 2)
          break
        case 'handleReportRecord':
          this.handleReportRecord(row)
          break


        case 'handleFeiyongmingxi':
          this.handleFeiyongmingxi(row)
          break
        case 'handleLog':
          this.handleLog(row)
          break
        case 'handleDetail':
          this.handleDetail(row)
          break
        case 'handleJiaocheyanchelist':
          this.handleJiaocheyanchelist(row)
          break
        case 'handleHuancheyanchelist':
          this.handleHuancheyanchelist(row)
          break
        case 'handleCancel':
          this.handleCancel(row)
          break
        case 'handleDelete':
          this.handleDelete(row)
          break
        default:
          break
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.orderTimeRange = []
      this.resetForm('queryForm')
      this.handleQuery()
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.$router.push({
        name: 'AddCharterOrder'
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      this.$modal
        .confirm('是否确认删除数据项？')
        .then(function () {
          return chartereddelete(row.orderNo)
        })
        .then(() => {
          this.getList()
          this.$modal.msgSuccess('删除成功')
        })
        .catch(() => {
        })
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams
      this.$modal
        .confirm('是否确认导出所有数据项？')
        .then(() => {
          this.exportLoading = true
          return exportBasic(queryParams)
        })
        .then((response) => {
          this.$download.name(response.msg)
          this.exportLoading = false
        })
        .catch(() => {
        })
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.orderNo)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 订单详情按钮 */
    handleDetail(row) {
      this.nowOrderNo = row.orderNo
      this.$router.push({
        name: 'CharteredBusDetail',
        query: {orderNo: row.orderNo}
      })
    },
    /** 删除按钮操作 */
    handleCancel(row) {
      this.$modal
        .confirm('是否确认取消吗？')
        .then(function () {
          return charteredcancel(row.orderNo)
        })
        .then(() => {
          this.getList()
          this.$modal.msgSuccess('取消成功')
        })
        .catch(() => {
        })
    },
    orderRefund(row) {
      this.nowOrderNo = row.orderNo
      this.showorderRefund = true
    },
    handleReportRecord(row) {
      this.nowOrderNo = row.orderNo
      this.showReportRecord = true
    },
    /** 编辑按钮操作 */
    handleEdit(row) {
      this.nowOrderNo = row.orderNo
      this.nowRow = row
      this.$router.push({
        name: 'AddCharterOrder',
        params:{
          orderNo:row.orderNo
        }
      })
    },
    /** 订单日志 */
    handleLog(row) {
      this.nowOrderNo = row.orderNo
      this.showdingdanlog = true
    },
    /** 订单排车 */
    handlePeiche(row) {
      this.nowOrderNo = row.orderNo
      this.nowRow = row
      this.showpeiche = true
    },
    /** 订单选择司机 */
    handleDispatchDriver(row) {
      this.nowOrderNo = row.orderNo
      this.showDriver = true
      this.nowRow = row
    },
    /** 确认分配司机 */
    confimDriver(row) {
      charteredDistributionDriver({
        userId: row.userId,
        orderNo: this.nowOrderNo,
        nickName: row.nickName
      }).then(res => {
        this.$message.success('分配司机成功')
        this.showDriver = false
        this.handleQuery()
      })
    },
    /*交还车验车*/
    handleDeliveryCar(row, type) {
      this.$router.push({
        name: 'CharteredBusDelivery',
        query: {orderNo: row.orderNo, type: type}
      })
    },


    /** 费用明细 */
    handleFeiyongmingxi(row) {
      this.nowOrderNo = row.orderNo
      this.showfeiyongmingxi = true
    },
    /** 交车验车 */
    handleJiaocheyanche(row) {
      this.nowOrderNo = row.orderNo
      this.showjiaocheyanche = true
    },
    /** 交车验车单 */
    handleJiaocheyanchelist(row) {
      this.nowOrderNo = row.orderNo
      this.showjiaocheyanchelist = true
    },
    /** 还车验车 */
    handleHuancheyanche(row) {
      this.nowOrderNo = row.orderNo
      this.huancheyanche = true
    },
    /** 还车验车单 */
    handleHuancheyanchelist(row) {
      this.nowOrderNo = row.orderNo
      this.huancheyanchelist = true
    },
    /** 押金结算 */
    handleSettlement(row) {
      this.nowOrderNo = row.orderNo
      this.showsettlement = true
    },
    /** 押金结算退款 */
    handleDepositRefund(row) {
      this.nowOrderNo = row.orderNo
      this.showDepositRefund = true
    },
    /** 违章押金结算退款 */
    handleIllegalProcessing(row) {
      this.nowOrderNo = row.orderNo
      this.showIllegalProcessing = true
    },
    OverDepositSettlement() {
      this.$modal.confirm('提交后将不可编辑,是否确认结算？').then(() => {
        api.overDepositSettlement(this.nowOrderNo).then((response) => {
          this.$message.success(response.msg)
          this.showDepositRefund = false
        })
      })
    },
    doDepositRefund(type, orderNo) {
      this.nowOrderNo = orderNo
      this.refundConfirmType = type
      switch (type) {
        case 3:
          this.refundConfirmTitle = '租车押金结算补缴'
          this.showDepositRefundConfirm = true
          break
        case 4:
          this.refundConfirmTitle = '租车押金结算退款'
          this.showDepositRefundConfirm = true
          break
      }
    },
    pingCallBack(type) {
      this.pingzheng.show = false
      if (type == 8) {
        api.cancel(this.nowOrderNo).then((response) => {
          this.$message.success(response.msg)
          this.closeDiolog()
        })
      } else {
        api.depositRefund(this.nowOrderNo).then((response) => {
          this.$message.success(response.msg)
          this.closeDiolog()
        })
      }
    },
    /** 违章结算 */
    handleSettlement2(row) {
      this.nowOrderNo = row.orderNo
      this.showsettlement2 = true
    },
    /** 违章结算单 */
    showFinalStatement(row) {
      this.nowOrderNo = row.orderNo
      this.finalStatement = true
    },
    /** 通用关闭弹窗处理方法 */
    closeDiolog() {
      this.nowOrderNo = null
      this.nowRow = null
      // this.handleQuery();
      this.getList()
    },
    /** 提交订单 */
    submitForm() {
      this.addSubmitLoading = true
      setTimeout(() => {
        this.addSubmitLoading = false
      }, 2e3)
      this.$refs['MmvAdd']?.emitData().then((form) => {
        if (this.nowOrderNo != null) {
          api.put(form).then((response) => {
            this.$modal.msgSuccess('修改成功')
            this.open = false
            this.getList()
          })
        } else {
          api.add(form).then((response) => {
            this.$modal.msgSuccess('新增成功')
            this.open = false
            this.getList()
          })
        }
      })
    },
    xxxxxx() {
    },
  },
}
</script>
